<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>ESD实时监控系统</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="/backend/plugins/element-ui/index.css">
    <link rel="stylesheet" href="/backend/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/backend/styles/list.css">
    <link rel="stylesheet" href="/backend/styles/device.css">
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>终端列表</h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item>首页</el-breadcrumb-item>
            <el-breadcrumb-item>终端管理</el-breadcrumb-item>
            <el-breadcrumb-item>终端列表</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
            <el-row>
                <el-col :span="24">
                    <div class="filter-container">
                        终端ID: <el-input placeholder="终端ID" v-model="pagination.stationId" style="width: 120px;" class="filter-item" > </el-input>
                        站点名称: <el-input placeholder="站点名称" v-model="pagination.position" style="width: 120px;" class="filter-item"></el-input>
                        终端类型:
                        <el-select v-model="pagination.deviceTypeId" placeholder="请选择" style="width: 150px">
                            <el-option v-for="item in deviceTypes" :key="item.deviceTypeId" :label="item.deviceTypeName" :value="item.deviceTypeId">
                            </el-option>
                        </el-select>
                        生产线:
                        <el-select v-model="pagination.lineId" placeholder="请选择" style="width: 150px">
                            <el-option v-for="item in lines" :key="item.lineId" :label="item.lineName" :value="item.lineId"></el-option>
                        </el-select>
                        <el-button type="primary" icon="el-icon-search" plain @click="findPage1()" style="margin-left: 15px;" class="dalfBut">查询</el-button>
                        <el-button type="default" icon="el-icon-delete-solid" class="dalfBut" plain @click="emptySearch()">清空查询条件</el-button>
                    </div>
                </el-col>
            </el-row>
            <el-row style="margin-top: 0.8vh;">
                <el-col :span="24" style="display: flex;">
                    <div class="filter-container">
                        <div style="margin-left: 15px">
                            <el-button type="primary" icon="el-icon-plus" plain class="dalfBut" @click="handleCreate()">添加</el-button>
                            <el-button type="danger" icon="el-icon-delete" class="dalfBut" plain @click="batchDelete">批量删除</el-button>
                            <el-button type="warning" icon="el-icon-sort" class="dalfBut" plain @click="handleSort()">调整顺序</el-button>
                        </div>
                    </div>
                    <div style="margin-left: 15px;" class="filter-container">
                        <el-upload action="/device/uploadDeviceData" accept=".xls,.xlsx" class="upload-file-uploader" ref="upload">
                            <el-button type="primary" icon="el-icon-upload" plain type="primary">通过文件上传</el-button>
                        </el-upload>
                    </div>
                </el-col>
            </el-row>
            <el-divider></el-divider>
            <el-table style="margin-top: 0.8vh;" size="small" current-row-key="deviceId" :data="dataList" @selection-change="handleSelectionChange" highlight-current-row style="width: 100%">
                <el-table-column type="selection" width="55px"></el-table-column>
                <el-table-column type="index" align="center" label="序号" align="center"></el-table-column>
                <el-table-column prop="stationId" label="终端ID" align="center"></el-table-column>
                <el-table-column prop="deviceTypeName" label="终端类型" align="center" width="200"></el-table-column>
                <el-table-column prop="line" label="生产线" align="center"></el-table-column>
                <el-table-column prop="position" label="工位" align="center"></el-table-column>
                <el-table-column prop="signalChannel" label="信道" align="center"></el-table-column>
                <el-table-column prop="serverIp" label="网关Ip" align="center"></el-table-column>
                <el-table-column prop="serverPort" label="网关端口" align="center"></el-table-column>
                <el-table-column prop="viewEnabled" label="开启监控" align="center" width="80">
                    <template slot-scope="scope">
                        <el-switch
                                v-model="scope.row.viewEnabled"
                                active-color="#13ce66"
                                inactive-color="#ff4949"
                                disabled
                        >
                        </el-switch>
                    </template>
                </el-table-column>
                <el-table-column prop="channelTypes" label="通道类型" align="center" width="200">
                    <template slot-scope="scope">
                            <span v-for="(item,index) in scope.row.channelTypes" :key="index">
                                <img :src="getChannelImg(item.channelTypeName)" :class="getChannelClass(item.enabled)"/>
                            </span>
                    </template>
                </el-table-column>
                <el-table-column label="操作" align="center" width="320">
                    <template slot-scope="scope">
                        <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
                        <el-button type="success" size="mini" @click="handleOperation(scope.row)">操作</el-button>
                        <el-button type="warning" v-if="scope.row.viewEnabled" size="mini" @click="enabledMon(scope.row.deviceId , 0)">关闭监控</el-button>
                        <el-button type="primary" v-else size="mini" @click="enabledMon(scope.row.deviceId , 1)">开启监控</el-button>
                        <el-button size="mini" type="danger" @click="handleDelete(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="pagination-container" style="margin-top: 0.8vh;">
                <el-pagination class="pagiantion" :page-sizes="[10, 20, 30, 40]" :page-size="pagination.pageSize"
                        :current-page.sync="pagination.currentPage" layout="total, sizes, prev, pager, next, jumper"
                        :total="pagination.total" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                ></el-pagination>
            </div>
            <!-- 新增或者编辑标签弹层 -->
            <div>
                <el-dialog :title="editTitle" :visible.sync="dialogFormVisible" center>
                    <el-form ref="dataAddForm" :model="formData" :rules="rules" label-position="right" label-width="100px">
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="终端ID" prop="stationId">
                                    <el-input v-model="formData.stationId"/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="站点位置" prop="position">
                                    <el-input v-model="formData.position"/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="产线" prop="lineId">
                                    <el-select v-model="formData.lineId" placeholder="请选择" style="width: 100px">
                                        <el-option v-for="item in lines" :key="item.lineId" :label="item.lineName" :value="item.lineId">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="终端类型" prop="deviceTypeId">
                                    <el-select v-model="formData.deviceTypeId" ref="deviceTypeSel">
                                        <el-option v-for="item in deviceTypes" :key="item.deviceTypeId" :label="item.deviceTypeName" :value="item.deviceTypeId">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="信道号">
                                    <el-input v-model="formData.signalChannel" disabled/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="16">
                                <el-form-item label="网关" prop="gatewayId">
                                    <el-select v-model="formData.gatewayId" @change="handleSelectChange" placeholder="请选择" style="width: 80%">
                                        <el-option v-for="item in gateways" :key="item.gatewayId" :label="showServer(item)" :value="item.gatewayId"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="6">
                                <el-form-item label="通道数">
                                    <el-select v-model="channelNumber">
                                        <el-option v-for="item in channelNumberList" :key="item" :label="item" :value="item">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row v-if="formData.deviceTypeId!=null&&channelNumber!=null&&channelNumber>=1">
                            <el-col :span="8">
                                <el-form-item label="通道1" prop="channelType">
                                    <el-select v-model="channels[0].channelTypeId" placeholder="请选择" style="width: 150px">
                                        <el-option v-for="item in channelTypes" :key="item.channelTypeId" :label="item.channelTypeName" :value="item.channelTypeId"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="站点位置" prop="enabled">
                                    <!-- <el-input v-model="channels[0].position" type="textarea"/> -->
                                    <el-input v-model="channels[0].position"/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="是否启用" prop="enabled">
                                    <el-switch v-model="channels[0].enabled" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row v-if="formData.deviceTypeId!=null&&channelNumber!=null&&channelNumber>=2">
                            <el-col :span="8">
                                <el-form-item label="通道2" prop="channelType">
                                    <el-select v-model="channels[1].channelTypeId" placeholder="请选择" style="width: 150px">
                                        <el-option v-for="item in channelTypes" :key="item.channelTypeId" :label="item.channelTypeName" :value="item.channelTypeId"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="站点位置" prop="enabled">
                                    <el-input v-model="channels[1].position"/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="是否启用" prop="enabled">
                                    <el-switch v-model="channels[1].enabled" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row v-if="formData.deviceTypeId!=null&&channelNumber!=null&&channelNumber>=3">
                            <el-col :span="8">
                                <el-form-item label="通道3" prop="channelType">
                                    <el-select v-model="channels[2].channelTypeId" placeholder="请选择" style="width: 150px">
                                        <el-option v-for="item in channelTypes" :key="item.channelTypeId" :label="item.channelTypeName" :value="item.channelTypeId"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="站点位置" prop="enabled">
                                    <el-input v-model="channels[2].position"/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="是否启用" prop="enabled">
                                    <el-switch v-model="channels[2].enabled" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row v-if="formData.deviceTypeId!=null&&channelNumber!=null&&channelNumber>=4">
                            <el-col :span="8"> <el-form-item label="通道4" prop="channelType">
                                    <el-select v-model="channels[3].channelTypeId" placeholder="请选择" style="width: 150px">
                                        <el-option v-for="item in channelTypes" :key="item.channelTypeId" :label="item.channelTypeName" :value="item.channelTypeId"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="站点位置" prop="enabled">
                                    <el-input v-model="channels[3].position"/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="是否启用" prop="enabled">
                                    <el-switch
                                            v-model="channels[3].enabled"
                                            active-color="#13ce66"
                                            inactive-color="#ff4949">
                                    </el-switch>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row v-if="formData.deviceTypeId!=null&&channelNumber!=null&&channelNumber>=5">
                            <el-col :span="8">
                                <el-form-item label="通道5" prop="channelType">
                                    <el-select v-model="channels[4].channelTypeId" placeholder="请选择" style="width: 150px">
                                        <el-option v-for="item in channelTypes" :key="item.channelTypeId" :label="item.channelTypeName" :value="item.channelTypeId"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="站点位置" prop="enabled">
                                    <el-input v-model="channels[4].position"/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="是否启用" prop="enabled" style="float: left;">
                                    <el-switch v-model="channels[4].enabled" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row v-if="formData.deviceTypeId!=null&&channelNumber!=null&&channelNumber>=6">
                            <el-col :span="8">
                                <el-form-item label="通道6" prop="channelType">
                                    <el-select v-model="channels[5].channelTypeId" placeholder="请选择" style="width: 150px">
                                        <el-option v-for="item in channelTypes" :key="item.channelTypeId" :label="item.channelTypeName" :value="item.channelTypeId"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="站点位置" prop="enabled">
                                    <el-input v-model="channels[5].position"/>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="是否启用" prop="enabled" style="float: left;">
                                    <el-switch v-model="channels[5].enabled" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="cancelOpt()">取消</el-button>
                        <el-button type="primary" @click="saveOrUpdate()">确定</el-button>
                    </div>
                </el-dialog>
            </div>
            <div>
                <el-dialog :title="dialogTitle" :visible.sync="operationFormVisible_fan"
                           width="50%" @close="closeDialog" center>
                    <el-tabs type="border-card" v-model="activeName">
                        <el-tab-pane label="风扇状态" name="getStatus">
                            <!--风扇状态-->
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24" style="margin-bottom: 10px;">
                                        <el-button style="margin-left: 10px;" type="primary" @click="fanGetStatus()">获取风扇状态
                                        </el-button>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <template v-if="fanDetailVo!=null&&deviceVo.deviceTypeName=='旧版离子风扇'">
                                        <el-descriptions class="margin-top" :column="4"  border>
                                            <el-descriptions-item>
                                                <template slot="label">终端类别</template>
                                                {{deviceVo.deviceTypeName}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">终端ID</template>
                                                {{deviceVo.stationId}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">终端信道</template>
                                                {{deviceVo.signalChannel}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">开关机</template>
                                                {{fanDetailVo.powerStatus}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                        <el-descriptions class="margin-top" :column="4"  border>
                                            <el-descriptions-item>
                                                <template slot="label">风档</template>
                                                {{fanDetailVo.windLevel}}档
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">封窗</template>
                                                {{fanDetailVo.windowOpen}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">清扫状态</template>
                                                {{fanDetailVo.cleanStatus}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">保养后工作小时</template>
                                                {{fanDetailVo.workTime}}&nbsp;&nbsp;小时
                                            </el-descriptions-item>
                                        </el-descriptions>
                                        <el-descriptions class="margin-top" :column="4"  border>
                                            <el-descriptions-item>
                                                <template slot="label">高压报警状态</template>
                                                {{fanDetailVo.highStatus}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">风扇报警状态</template>
                                                {{fanDetailVo.fanStatus}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">平衡电压</template>
                                                {{fanDetailVo.phdy}}V
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">放电针电压</template>
                                                {{fanDetailVo.fdzdy}}V
                                            </el-descriptions-item>
                                        </el-descriptions>
                                    </template>
                                    <template v-if="fanDetailVo!=null&&deviceVo.deviceTypeName=='离子风扇'">
                                        <el-descriptions class="margin-top" :column="4"  border>
                                            <el-descriptions-item>
                                                <template slot="label">终端类别</template>
                                                {{deviceVo.deviceTypeName}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">终端ID</template>
                                                {{deviceVo.stationId}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">终端信道</template>
                                                {{deviceVo.signalChannel}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">开关机</template>
                                                {{fanDetailVo.powerStatus}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                        <el-descriptions class="margin-top" :column="4"  border>
                                            <el-descriptions-item>
                                                <template slot="label">风档</template>
                                                {{fanDetailVo.windLevel}}档
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">报警状态</template>
                                                {{fanDetailVo.fanStatus}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">是否在清扫</template>
                                                {{fanDetailVo.cleanStatus}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">已工作</template>
                                                {{fanDetailVo.hasWorkTime}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                        <el-descriptions class="margin-top" :column="2"  border>
                                            <el-descriptions-item>
                                                <template slot="label">风扇状态</template>
                                                {{fanDetailVo.fanStatusList}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">风门状态</template>
                                                {{fanDetailVo.openWindowStatusList}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                        <el-descriptions class="margin-top" :column="2"  border>
                                            <el-descriptions-item>
                                                <template slot="label">高压状态</template>
                                                {{fanDetailVo.highStatusList}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">清扫状态</template>
                                                {{fanDetailVo.cleaStatusList}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                        <el-descriptions class="margin-top" :column="2"  border>
                                            <el-descriptions-item>
                                                <template slot="label">放电针电压</template>
                                                {{fanDetailVo.powerList}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">平衡电压</template>
                                                {{fanDetailVo.balancePowerList}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                    </template>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="开关机">
                            选择操作对象:&nbsp;&nbsp;
                            <template>
                                <el-radio v-model="line_radio" label="1">自己</el-radio>
                                <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                            </template>
                            <el-button type="primary" @click="handleFanSwitch('01')">开机</el-button>
                            <el-button type="success" @click="handleFanSwitch('00')">关机</el-button>
                        </el-tab-pane>
                        <el-tab-pane label="风挡锁" v-if="isNewFan">
                            选择操作对象:&nbsp;&nbsp;
                            <template>
                                <el-radio v-model="line_radio" label="1">自己</el-radio>
                                <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                            </template>
                            <el-button type="primary" @click="handleFanLevelSwitch('01')">风挡按键锁定</el-button>
                            <el-button type="success" @click="handleFanLevelSwitch('00')">风挡按键解锁</el-button>
                        </el-tab-pane>
                        <el-tab-pane label="档位调节">
                            选择操作对象:&nbsp;&nbsp;
                            <template>
                                <el-radio v-model="line_radio" label="1">自己</el-radio>
                                <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                            </template>
                            <br/>
                            风扇档位:
                            <el-select v-model="fanLevel" placeholder="请选择" style="width: 100px; margin-top: 15px;">
                                <el-option v-for="item in fanLevels" :key="item" :label="item" :value="item"></el-option>
                            </el-select>
                            <el-button type="primary" @click="fanLevelHandle()">确认调整风扇档位</el-button>
                        </el-tab-pane>
                        <el-tab-pane label="校正时间">
                            选择操作对象:&nbsp;&nbsp;
                            <template>
                                <el-radio v-model="line_radio" label="1">自己</el-radio>
                                <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                            </template>
                            <el-button type="primary" @click="fanHandleTime()">确认校正时间</el-button>
                        </el-tab-pane>
                        <el-tab-pane label="自启动时间">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24" style="margin-bottom: 10px;">
                                        选择操作对象:&nbsp;&nbsp;
                                        <template>
                                            <el-radio v-model="line_radio" label="1">自己</el-radio>
                                            <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                        </template>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    自启动时间一(早上):
                                    <el-time-picker placeholder="自启动时间一(早上)" v-model="fanStartTime1"
                                                    :format="'HH:mm:ss'" :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    <el-button type="warning" @click="fanGetStartTime('02')">获取</el-button>
                                    <el-button type="primary" @click="fanSetStartTime('02')">修改</el-button>
                                </el-row>
                                <el-row style="margin-top: 10px;">
                                    自启动时间二(下午):
                                    <el-time-picker placeholder="自启动时间二(下午)" v-model="fanStartTime2"
                                                    :format="'HH:mm:ss'" :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    <el-button type="warning" @click="fanGetStartTime('03')">获取</el-button>
                                    <el-button type="primary" @click="fanSetStartTime('03')">修改</el-button>
                                </el-row>
                                <el-row style="margin-top: 10px;">
                                    自启动时间三(晚上):
                                    <el-time-picker placeholder="自启动时间三(晚上)" v-model="fanStartTime3"
                                                    :format="'HH:mm:ss'" :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    <el-button type="warning" @click="fanGetStartTime('04')">获取</el-button>
                                    <el-button type="primary" @click="fanSetStartTime('04')">修改</el-button>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="休眠时间">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24" style="margin-bottom: 10px;">
                                        选择操作对象:&nbsp;&nbsp;
                                        <template>
                                            <el-radio v-model="line_radio" label="1">自己</el-radio>
                                            <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                        </template>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    休眠时间(上午):
                                    <el-time-picker placeholder="休眠时间(上午)" v-model="fanSleepTime1"
                                                    :format="'HH:mm:ss'" :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    <el-button type="warning" @click="fanGetSleepTime('05')">获取</el-button>
                                    <el-button type="primary" @click="fanSetSleepTime('05')">修改</el-button>
                                </el-row>
                                <el-row style="margin-top: 10px;">
                                    休眠时间(下午):
                                    <el-time-picker placeholder="休眠时间(下午)" v-model="fanSleepTime2"
                                                    :format="'HH:mm:ss'" :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    <el-button type="warning" @click="fanGetSleepTime('06')">获取</el-button>
                                    <el-button type="primary" @click="fanSetSleepTime('06')">修改</el-button>
                                </el-row>
                                <el-row style="margin-top: 10px;">
                                    休眠时间(晚上):
                                    <el-time-picker placeholder="休眠时间(晚上)" v-model="fanSleepTime3"
                                                    :format="'HH:mm:ss'" :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    <el-button type="warning" @click="fanGetSleepTime('07')">获取</el-button>
                                    <el-button type="primary" @click="fanSetSleepTime('07')">修改</el-button>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="清扫时间">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24" style="margin-bottom: 10px;">
                                        选择操作对象:&nbsp;&nbsp;
                                        <template>
                                            <el-radio v-model="line_radio" label="1">自己</el-radio>
                                            <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                        </template>
                                        <el-button type="warning" @click="fanGetCleanTime()">获取时间
                                        </el-button>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    清扫时间:
                                    <el-time-picker placeholder="休眠时间" v-model="fanCleanTime"
                                                    :format="'HH:mm:ss'" :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    <el-button type="primary" @click="fanSetCleanTime()">确认调整</el-button>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="平衡电压">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24">
                                        选择操作对象:&nbsp;&nbsp;
                                        <template>
                                            <el-radio v-model="line_radio" label="1">自己</el-radio>
                                            <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                        </template>
                                        <el-button type="warning" @click="fanGetBalancePower()">获取平衡电压</el-button>
                                    </el-col>
                                </el-row>
                                <el-row style="margin-top: 10px;">
                                    <el-col :span="24">
                                        平衡电压:
                                        <el-input placeholder=">=0" type="number" v-model="lowDYValue" style="width: 150px;"
                                                  oninput="value=value.replace(/\D/g,'')">
                                        </el-input>
                                        至
                                        <el-input placeholder="<=99" type="number" style="width: 150px;"
                                                  oninput="value=value.replace(/\D/g,'')" v-model="highDYValue">
                                            <template slot="append">V</template>
                                        </el-input>
                                        <el-button type="primary" @click="fanSetBalanceDY()">修改平衡电压</el-button>
                                    </el-col>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="放电针电压">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24">
                                        选择操作对象:&nbsp;&nbsp;
                                        <template>
                                            <el-radio v-model="line_radio" label="1">自己</el-radio>
                                            <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                        </template>
                                        <el-button type="warning" @click="fanGetFDZDY()">获取放电针电压</el-button>
                                    </el-col>
                                </el-row>
                                <el-row style="margin-top: 10px;">
                                    <el-col :span="24">
                                        放电针电压:
                                        <el-input placeholder=">=0" type="number" v-model="lowFDZDYValue" style="width: 150px;"
                                                  oninput="value=value.replace(/\D/g,'')"></el-input>
                                        至
                                        <el-input placeholder="<=99" type="number" style="width: 150px;"
                                                  oninput="value=value.replace(/\D/g,'')" v-model="highFDZDYValue">
                                            <template slot="append">V</template>
                                        </el-input>
                                        <el-button type="primary" @click="fanSetFDZDY()">修改放电针电压</el-button>
                                    </el-col>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="保养时间">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24" style="margin-bottom: 10px;">
                                        选择操作对象:&nbsp;&nbsp;
                                        <template>
                                            <el-radio v-model="line_radio" label="1">自己</el-radio>
                                            <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                        </template>
                                        <el-button type="warning" @click="fanGetMaintainTime()">获取保养时间</el-button>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    保养时间:
                                    <el-input placeholder="保养时间" type="number" style="margin-left: 5px; width: 200px;"
                                              v-model="maintainTime"
                                              oninput="if(value > 100) value = 100; if(value < 0 || value === '' || value === null) value = 0;"
                                              :maxlength="3" :minlength="1">
                                        <template slot="append">小时</template>
                                    </el-input>
                                    <el-button type="primary" @click="fanSetMaintainTime()">确认调整保养时间</el-button>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="更改信道" v-if="deviceVo.deviceTypeName=='离子风扇'">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24">
                                        信道:
                                        <el-select v-model="change_gatewayId" placeholder="请选择" style="width: 45%">
                                            <el-option v-for="item in gateways" :key="item.gatewayId" :label="showServer(item)"
                                                       :value="item.gatewayId"></el-option>
                                        </el-select>
                                        <el-button style="margin-left: 5px;" type="primary" @click="handleFanXindao()">
                                            确认修改网关及信道
                                        </el-button>
                                    </el-col>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                    </el-tabs>
                </el-dialog>
            </div>
            <div>
                <el-dialog :title="dialogTitle" :visible.sync="operationFormVisible"
                           width="40%" @close="closeDialog" center>
                    <el-tabs type="border-card" v-model="activeName">
                        <el-tab-pane label="获取状态" name="getStatus">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24" style="margin-bottom: 10px;">
                                        <el-button style="margin-left: 10px;" type="primary" @click="handleGetStatus()">
                                            获取终端当前状态
                                        </el-button>
                                    </el-col>
                                </el-row>
                                <template v-if="currentStatus!=null">
                                    <el-descriptions class="margin-top" :column="2"  border>
                                        <el-descriptions-item>
                                            <template slot="label"> 终端类别</template>
                                            {{deviceVo.deviceTypeName}}{{currentStatus.channelType}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label"> 终端ID</template>
                                            {{deviceVo.stationId}}
                                        </el-descriptions-item>
                                    </el-descriptions>
                                    <el-descriptions class="margin-top" :column="3"  border>
                                        <el-descriptions-item v-if="isOld3Channel">
                                            <template slot="label">终端当前时间</template>
                                            {{currentStatus.timeStr}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label">终端信道</template>
                                            {{deviceVo.signalChannel}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label">开启声音</template>
                                            {{currentStatus.soundOn}}
                                        </el-descriptions-item>
                                    </el-descriptions>
                                    <el-descriptions class="margin-top" :column="3"  border>
                                        <el-descriptions-item>
                                            <template slot="label">通道一电阻值</template>
                                            {{currentStatus.tdjddz}}Ω
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label">通道二电阻值</template>
                                            {{currentStatus.rtjddz}}Ω
                                        </el-descriptions-item>
                                        <el-descriptions-item v-if="isOld3Channel">
                                            <template slot="label">通道三电阻值</template>
                                            {{currentStatus.sbjddz}}Ω
                                        </el-descriptions-item>
                                    </el-descriptions>
                                    <el-descriptions class="margin-top" :column="3"  border>
                                        <el-descriptions-item>
                                            <template slot="label">通道一有手环接入</template>
                                            {{currentStatus.channel1}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label">通道二有手环接入</template>
                                            {{currentStatus.channel2}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label">地线状态</template>
                                            {{currentStatus.dxzt}}
                                        </el-descriptions-item>
                                    </el-descriptions>
                                    <el-descriptions class="margin-top" :column="4"  border>
                                        <el-descriptions-item>
                                            <template slot="label">通道一状态</template>
                                            {{currentStatus.channel1Status}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label">通道二状态</template>
                                            {{currentStatus.channel2Status}}
                                        </el-descriptions-item>
                                        <el-descriptions-item v-if="isOld3Channel">
                                            <template slot="label">通道三状态</template>
                                            {{currentStatus.channel3Status}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label">地线状态</template>
                                            {{currentStatus.dxStatus}}
                                        </el-descriptions-item>
                                    </el-descriptions>
                                </template>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane v-if="isOld3Channel" label="校正时间">
                            选择操作对象:&nbsp;&nbsp;
                            <template>
                                <el-radio v-model="line_radio" label="1">自己</el-radio>
                                <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                            </template>
                            <el-button type="primary" @click="handleTime()">确认校正时间</el-button>
                        </el-tab-pane>
                        <el-tab-pane label="屏幕显示">
                            选择操作对象:&nbsp;&nbsp;
                            <template>
                                <el-radio v-model="line_radio" label="1">自己</el-radio>
                                <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                            </template>
                            <el-button type="primary" @click="handleScreenOn('01')">开启</el-button>
                            <el-button type="danger" @click="handleScreenOn('00')">关闭</el-button>
                        </el-tab-pane>
                        <el-tab-pane v-if="isOld3Channel" label="工作时间">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24">
                                        选择操作对象:&nbsp;&nbsp;
                                        <template>
                                            <el-radio v-model="line_radio" label="1">自己</el-radio>
                                            <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                        </template>
                                    </el-col>
                                </el-row>
                                <el-row style="margin-top: 15px;">
                                    <el-col :span="24">
                                        早上:
                                        <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime1"
                                                        :format="'HH:mm:ss'"
                                                        :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                        </el-time-picker>
                                        至
                                        <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime1"
                                                        :format="'HH:mm:ss'"
                                                        :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                        </el-time-picker>
                                    </el-col>
                                </el-row>
                                <el-row style="margin-top: 15px;">
                                    <el-col :span="24">
                                        下午:
                                        <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime2"
                                                        :format="'HH:mm:ss'"
                                                        :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                        </el-time-picker>
                                        至
                                        <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime2"
                                                        :format="'HH:mm:ss'"
                                                        :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                        </el-time-picker>
                                    </el-col>
                                </el-row>
                                <el-row style="margin-top: 15px;">
                                    <el-col :span="24">
                                        晚上:
                                        <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime3"
                                                        :format="'HH:mm:ss'"
                                                        :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                        </el-time-picker>
                                        至
                                        <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime3"
                                                        :format="'HH:mm:ss'"
                                                        :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                        </el-time-picker>
                                    </el-col>
                                </el-row>
                                <el-row style="margin-top: 15px;">
                                    <el-col :span="24">
                                        <el-button type="warning" @click="handleGetWorkTime()">获取工作时间</el-button>
                                        <el-button type="primary" @click="handleSetWorkTime()">确认修改</el-button>
                                    </el-col>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="终端发声" style="text-align: center;">
                            <el-button type="primary" @click="handleSound('01')">开启声音</el-button>
                            <el-button type="danger" @click="handleSound('00')">关闭声音</el-button>
                        </el-tab-pane>
                        <el-tab-pane label="阀值管理">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24" style="margin-bottom: 10px;">
                                        选择操作对象:&nbsp;&nbsp;
                                        <template>
                                            <el-radio v-model="line_radio" label="1">自己</el-radio>
                                            <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                        </template>
                                        <el-button type="warning" @click="handleGetScale()">获取阀值</el-button>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="24">
                                        <span v-if="isOld3Channel">
                                            通道一:&nbsp;
                                            <el-input style="width: 150px;" placeholder=">=0" type="number"
                                                      v-model="lowValue1">
                                            </el-input>
                                        </span>
                                        <span v-else>
                                            电阻仪阀值:&nbsp;
                                            <el-input style="width: 150px;" placeholder=">=0" type="number"
                                                      v-model="lowValue1"></el-input>
                                        </span>
                                        至
                                        <el-input placeholder="<=99" type="number" style="width: 200px;" v-model="highValue1">
                                            <template slot="append" v-if="isMOM1">Ω</template>
                                            <template slot="append" v-else="isMOM1">MΩ</template>
                                        </el-input>
                                        <el-button type="primary" @click="handleSetScale('11')">修改</el-button>
                                    </el-col>
                                </el-row>
                                <el-row v-if="isOld3Channel" style="margin-top: 10px;">
                                    <el-col :span="24">
                                        通道二:&nbsp;
                                        <el-input style="width: 150px;" placeholder=">=0" type="number"
                                                  v-model="lowValue2"></el-input>
                                        至
                                        <el-input placeholder="<=99" type="number" style="width: 200px;" v-model="highValue2">
                                            <template slot="append" v-if="isMOM2">Ω</template>
                                            <template slot="append" v-else="isMOM2">MΩ</template>
                                        </el-input>
                                        <el-button type="primary" @click="handleSetScale('15')">修改</el-button>
                                    </el-col>
                                </el-row>
                                <el-row v-if="isOld3Channel" style="margin-top: 10px;">
                                    <el-col :span="24">
                                        通道三:&nbsp;
                                        <el-input style="width: 150px;" placeholder=">=0" type="number"
                                                  v-model="lowValue3"></el-input>
                                        至
                                        <el-input style="width: 200px;" placeholder="<=99" type="number" v-model="highValue3">
                                            <template slot="append">Ω</template>
                                        </el-input>
                                        <el-button type="primary" @click="handleSetScale('19')">修改</el-button>
                                    </el-col>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="更改信道">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24">
                                        信道:
                                        <el-select v-model="change_gatewayId"
                                                   placeholder="请选择" style="width: 60%">
                                            <el-option v-for="item in gateways" :key="item.gatewayId" :label="showServer(item)"
                                                       :value="item.gatewayId"></el-option>
                                        </el-select>
                                        <el-button style="margin-left: 5px;" type="primary" @click="handleXindao()">
                                            确认修改网关及信道
                                        </el-button>
                                    </el-col>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                    </el-tabs>
                </el-dialog>
            </div>
            <div>
                <el-dialog title="温湿度计操作" :visible.sync="operationFormVisible_Tem"
                           width="40%" @close="closeDialog" center>
                        <el-tabs type="border-card" v-model="activeName">
                            <el-tab-pane label="查询状态" name="getStatus">
                                <el-button type="primary" @click="getTemDetail()">查询状态</el-button>
                                <br/>
                                {{temDetail.tem}}
                                <br/>
                                {{temDetail.humi}}
                            </el-tab-pane>
                            <el-tab-pane label="校正时间">
                                <el-button type="primary" @click="handleTemTime()">校正时间</el-button>
                            </el-tab-pane>
                            <el-tab-pane label="报警开关">
                                温度:&nbsp;&nbsp;
                                <el-button type="primary" @click="temClick('01')">开启</el-button>
                                <el-button type="danger" @click="temClick('00')">关闭</el-button>
                                <br/>
                                湿度:&nbsp;&nbsp;
                                <el-button type="primary" @click="humiClick('01')" style="margin-top: 5px;">开启</el-button>
                                <el-button type="danger" @click="humiClick('00')" style="margin-top: 5px;">关闭</el-button>
                            </el-tab-pane>
                            <el-tab-pane label="设置报警上下限">
                                温度:&nbsp;&nbsp;
                                <template>
                                    <el-input style="width: 150px;" placeholder=">=-10" type="number"
                                        v-model="temLower"></el-input>
                                    至
                                    <el-input style="width: 200px;" placeholder="<=40" type="number" v-model="temUpper">
                                        <template slot="append">℃</template>
                                    </el-input>
                                </template>
                                <el-button type="warning" @click="setTemScale()">设置</el-button>
                                <el-button type="primary" @click="getTemScale()">查询</el-button>
                                <br/>
                                湿度:&nbsp;&nbsp;
                                <template>
                                    <el-input style="width: 150px;" placeholder=">=20" type="number"
                                        v-model="humiLower" style="margin-top: 5px;"></el-input>
                                    至
                                    <el-input style="width: 200px;" placeholder="<=99" type="number" v-model="humiUpper">
                                        <template slot="append" style="margin-top: 5px;">%</template>
                                    </el-input>
                                </template>
                                <el-button type="warning" @click="setHumiScale()" style="margin-top: 5px;">设置</el-button>
                                <el-button type="primary" @click="getHumiScale()" style="margin-top: 5px;">查询</el-button>
                            </el-tab-pane>
                        </el-tabs>
                </el-dialog>
            </div>
            <div>
                <el-dialog :title="dialogTitle" :visible.sync="operationFormVisible_NewDZY"
                           width="40%" @close="closeDialog" center>
                        <el-tabs type="border-card" v-model="activeName">
                            <el-tab-pane label="查询状态" name="getStatus">
                                <el-button type="primary" @click="getDetailsNew()">查询状态</el-button>
                                <template v-if="dzyDetailNew!=null">
                                    <el-descriptions class="margin-top" :column="3" border style="margin-top: 5px;">
                                        <el-descriptions-item>
                                            <template slot="label">终端类别</template>
                                            {{deviceVo.deviceTypeName}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label"> 终端ID</template>
                                            {{deviceVo.stationId}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label"> 信道</template>
                                            {{dzyDetailNew.signalChannel}}
                                        </el-descriptions-item>
                                    </el-descriptions>
                                    <el-descriptions class="margin-top" :column="2" border>
                                        <el-descriptions-item>
                                            <template slot="label">通道启用详情</template>
                                            {{dzyDetailNew.channelEnabled}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label"> 通道模式</template>
                                            {{dzyDetailNew.channelMode}}
                                        </el-descriptions-item>
                                    </el-descriptions>
                                    <el-descriptions class="margin-top" :column="2" border>
                                        <el-descriptions-item>
                                            <template slot="label">通道电阻值</template>
                                            {{dzyDetailNew.numStr}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label"> 是否有手环插入</template>
                                            {{dzyDetailNew.insertFlag}}
                                        </el-descriptions-item>
                                    </el-descriptions>
                                    <el-descriptions class="margin-top" :column="2" border>
                                        <el-descriptions-item>
                                            <template slot="label">通道状态</template>
                                            {{dzyDetailNew.compareResult}}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template slot="label"> 地线状态</template>
                                            {{dzyDetailNew.groundStatus}}
                                        </el-descriptions-item>
                                    </el-descriptions>
                                </template>    
                            </el-tab-pane>
                            <el-tab-pane label="校正时间">
                                选择操作对象:&nbsp;&nbsp;
                                <template>
                                    <el-radio v-model="line_radio" label="1">自己</el-radio>
                                    <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                </template>
                                <el-button type="primary" @click="newCheckTime()">确认校正时间</el-button>
                            </el-tab-pane>
                            <el-tab-pane label="发出声音">
                                <el-button type="primary" @click="newSoundOn()">发出声音</el-button>
                            </el-tab-pane>
                            <el-tab-pane label="按键锁">
                                <el-form label-position="right" label-width="100px">
                                    选择操作对象:&nbsp;&nbsp;
                                    <template>
                                        <el-radio v-model="line_radio" label="1">自己</el-radio>
                                        <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                    </template>
                                    <el-button type="primary" @click="newLockKey('00')">解锁</el-button>
                                    <el-button type="warning" @click="newLockKey('01')">上锁</el-button>
                                </el-form>
                            </el-tab-pane>
                            <el-tab-pane label="通道开关">
                                <el-button type="primary" icon="el-icon-check" @click="checkChOn()">校正数据库</el-button>
                                <el-button style="margin-left: 1vw;" type="warning" icon="el-icon-search" @click="searchChOn()">查询现状</el-button>
                                <br/>
                                <template v-if="channelOnDT!=null">
                                    <span v-if="channelOnDT.chOn1">通道1: <el-button style="margin-top: 5px;" type="danger" @click="changeChOn(-1)">关闭</el-button></span> 
                                    <span v-else="channelOnDT.chOn1">通道1: <el-button style="margin-top: 5px;" type="primary" @click="changeChOn(1)">开启</el-button></span> 
                                    <span v-if="channelOnDT.chOn2">通道2: <el-button style="margin-top: 5px;" type="danger" @click="changeChOn(-2)">关闭</el-button></span> 
                                    <span v-else="channelOnDT.chOn2">通道2: <el-button style="margin-top: 5px;" type="primary" @click="changeChOn(2)">开启</el-button></span> 
                                </template>
                                <br/>
                                <template v-if="channelOnDT!=null&&dialogTitle=='新版接地电阻仪（4通道）操作'">
                                    <span v-if="channelOnDT.chOn3">通道3: <el-button style="margin-top: 5px;" type="danger" @click="changeChOn(-4)">关闭</el-button></span> 
                                    <span v-else="channelOnDT.chOn3">通道3: <el-button style="margin-top: 5px;" type="primary" @click="changeChOn(4)">开启</el-button></span> 
                                    <span v-if="channelOnDT.chOn4">通道4: <el-button style="margin-top: 5px;" type="danger" @click="changeChOn(-8)">关闭</el-button></span> 
                                    <span v-else="channelOnDT.chOn4">通道4: <el-button style="margin-top: 5px;" type="primary" @click="changeChOn(8)">开启</el-button></span> 
                                </template>
                            </el-tab-pane>
                            <el-tab-pane label="通道设置">
                                <el-button type="primary" icon="el-icon-check" @click="checkChTypes()">校正数据库</el-button>
                                <el-button type="warning" icon="el-icon-search" @click="searchChTypes()">查询现状</el-button>
                                <br/>
                                <template v-if="channelTypeList!=null">
                                    <span>通道1: 
                                        <el-select v-model="channelTypeList.ch1" style="width: 150px; margin-top: 5px;">
                                            <el-option v-for="item in channelTypeSel" :key="item.id" :label="item.label" :value="item.id">
                                            </el-option>
                                        </el-select>
                                        <el-button style="margin-top: 5px;" type="primary" @click="changeChType('0A')">修改</el-button>
                                    </span> 
                                    <span>通道2: 
                                        <el-select v-model="channelTypeList.ch2" style="width: 150px; margin-top: 5px;">
                                            <el-option v-for="item in channelTypeSel" :key="item.id" :label="item.label" :value="item.id">
                                            </el-option>
                                        </el-select>
                                        <el-button style="margin-top: 5px;" type="primary" @click="changeChType('0B')">修改</el-button>
                                    </span> 
                                </template>
                                <br/>
                                <template v-if="channelTypeList!=null&&dialogTitle=='新版接地电阻仪（4通道）操作'">
                                    <span>通道3: 
                                        <el-select v-model="channelTypeList.ch3" style="width: 150px; margin-top: 5px;">
                                            <el-option v-for="item in channelTypeSel" :key="item.id" :label="item.label" :value="item.id">
                                            </el-option>
                                        </el-select>
                                        <el-button style="margin-top: 5px;" type="primary" @click="changeChType('0C')">修改</el-button>
                                    </span> 
                                    <span>通道4: 
                                        <el-select v-model="channelTypeList.ch4" style="width: 150px; margin-top: 5px;">
                                            <el-option v-for="item in channelTypeSel" :key="item.id" :label="item.label" :value="item.id">
                                            </el-option>
                                        </el-select>
                                        <el-button style="margin-top: 5px;" type="primary" @click="changeChType('0D')">修改</el-button>
                                    </span> 
                                </template>
                            </el-tab-pane>
                            <el-tab-pane label="阀值管理">
                                <el-form label-position="right" label-width="100px">
                                    <el-row>
                                        <el-col :span="24" style="margin-bottom: 10px;">
                                            选择操作对象:&nbsp;&nbsp;
                                            <template>
                                                <el-radio v-model="line_radio" label="1">自己</el-radio>
                                                <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                            </template>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="24">
                                            设备:&nbsp;
                                            <el-input style="width: 150px;" placeholder=">=0" type="number"
                                                        v-model="lowValue1">
                                            </el-input>
                                            至
                                            <el-input placeholder="<=99" type="number" style="width: 200px;" v-model="highValue1">
                                                <template slot="append">Ω</template>
                                            </el-input>
                                            <el-button type="warning" @click="handleGetScaleNew('1C')">获取</el-button>
                                            <el-button type="primary" @click="handleSetScaleNew('1C')" >修改</el-button>
                                        </el-col>
                                    </el-row>
                                    <el-row style="margin-top: 10px;">
                                        <el-col :span="24">
                                            台垫:&nbsp;
                                            <el-input style="width: 150px;" placeholder=">=0" type="number"
                                                      v-model="lowValue2"></el-input>
                                            至
                                            <el-input style="width: 200px;" placeholder="<=99" type="number" v-model="highValue2">
                                                <template slot="append">MΩ</template>
                                            </el-input>
                                            <el-button type="warning" @click="handleGetScaleNew('20')">获取</el-button>
                                            <el-button type="primary" @click="handleSetScaleNew('20')">修改</el-button>
                                        </el-col>
                                    </el-row>
                                    <el-row style="margin-top: 10px;">
                                        <el-col :span="24">
                                            人体:&nbsp;
                                            <el-input style="width: 150px;" placeholder=">=0" type="number"
                                                      v-model="lowValue3"></el-input>
                                            至
                                            <el-input style="width: 200px;" placeholder="<=99" type="number" v-model="highValue3">
                                                <template slot="append">MΩ</template>
                                            </el-input>
                                            <el-button type="warning" @click="handleGetScaleNew('24')">获取</el-button>
                                            <el-button type="primary" @click="handleSetScaleNew('24')">修改</el-button>
                                        </el-col>
                                    </el-row>
                                </el-form>
                            </el-tab-pane>
                            <el-tab-pane label="红外感应">
                                <el-form label-position="right" label-width="100px">
                                    当前红外感应是否开启: <el-switch v-model="redClock" v-if="redClock!=null" style="margin-left: 1vw;"
                                        active-color="#13ce66" inactive-color="#ff4949" disabled></el-switch>
                                    <span v-if="redClock==null" style="margin-left: 1vw;">未查询</span>
                                    <el-button type="primary" icon="el-icon-search" style="margin-left: 1vw;" @click="checkRedClock()">查询当前状态</el-button>
                                </el-form>
                                <el-form label-position="right" label-width="100px" style="margin-top: 1vh;">
                                    选择操作对象:&nbsp;&nbsp;
                                    <template>
                                        <el-radio v-model="line_radio" label="1">自己</el-radio>
                                        <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                    </template>
                                    <el-button type="danger" @click="newInfraredOn('00')">关闭</el-button>
                                    <el-button type="success" @click="newInfraredOn('0F')">开启</el-button>
                                </el-form>
                            </el-tab-pane>
                            <el-tab-pane label="工作时间">
                                <el-form label-position="right" label-width="100px">
                                    <el-row>
                                        <el-col :span="24">
                                            选择操作对象:&nbsp;&nbsp;
                                            <template>
                                                <el-radio v-model="line_radio" label="1">自己</el-radio>
                                                <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                            </template>
                                        </el-col>
                                    </el-row>
                                    <el-row style="margin-top: 15px;">
                                        <el-col :span="24">
                                            上午:
                                            <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime1"
                                                            :format="'HH:mm:ss'"
                                                            :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                            </el-time-picker>
                                            至
                                            <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime1"
                                                            :format="'HH:mm:ss'"
                                                            :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                            </el-time-picker>
                                            <el-button type="warning" @click="handleGetWorkTimeNew('28')">获取</el-button>
                                            <el-button type="primary" @click="handleSetWorkTimeNew('28')">修改</el-button>
                                        </el-col>
                                    </el-row>
                                    <el-row style="margin-top: 15px;">
                                        <el-col :span="24">
                                            下午:
                                            <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime2"
                                                            :format="'HH:mm:ss'"
                                                            :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                            </el-time-picker>
                                            至
                                            <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime2"
                                                            :format="'HH:mm:ss'"
                                                            :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                            </el-time-picker>
                                            <el-button type="warning" @click="handleGetWorkTimeNew('2E')">获取</el-button>
                                            <el-button type="primary" @click="handleSetWorkTimeNew('2E')">修改</el-button>
                                        </el-col>
                                    </el-row>
                                    <el-row style="margin-top: 15px;">
                                        <el-col :span="24">
                                            晚上:
                                            <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime3"
                                                            :format="'HH:mm:ss'"
                                                            :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                            </el-time-picker>
                                            至
                                            <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime3"
                                                            :format="'HH:mm:ss'"
                                                            :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                            </el-time-picker>
                                            <el-button type="warning" @click="handleGetWorkTimeNew('34')">获取</el-button>
                                            <el-button type="primary" @click="handleSetWorkTimeNew('34')">修改</el-button>
                                        </el-col>
                                    </el-row>
                                </el-form>
                            </el-tab-pane>
                            <el-tab-pane label="信道">
                                <el-form label-position="right" label-width="100px">
                                    <el-row>
                                        <el-col :span="24">
                                            信道:
                                            <el-select v-model="change_gatewayId"
                                                       placeholder="请选择" style="width: 60%">
                                                <el-option v-for="item in gateways" :key="item.gatewayId" :label="showServer(item)"
                                                           :value="item.gatewayId"></el-option>
                                            </el-select>
                                            <el-button style="margin-left: 5px;" type="primary" @click="newXindao()">
                                                确认修改网关及信道
                                            </el-button>
                                        </el-col>
                                    </el-row>
                                </el-form>
                            </el-tab-pane>
                        </el-tabs>
                </el-dialog>
            </div>
            <div>
                <el-dialog :title="dialogTitle" :visible.sync="operationFormVisible_chenAi"
                           width="40%" @close="closeDialog" center>
                    <el-tabs type="border-card" v-model="activeName">
                        <el-tab-pane label="状态信息" name="getStatus">
                            <el-form label-position="right" label-width="100px">
                                <el-row>
                                    <el-col :span="24" style="margin-bottom: 10px;">
                                        <el-button style="margin-left: 10px;" type="primary" @click="getDustStatus()">获取状态
                                        </el-button>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <template v-if="dustStatus!=null">
                                        <el-descriptions class="margin-top" :column="2" border style="margin-top: 5px;">
                                            <el-descriptions-item>
                                                <template slot="label">0.3um</template>
                                                {{dustStatus.data1}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">0.5um</template>
                                                {{dustStatus.data2}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                        <el-descriptions class="margin-top" :column="2" border>
                                            <el-descriptions-item>
                                                <template slot="label">1.0um</template>
                                                {{dustStatus.data3}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">2.5um</template>
                                                {{dustStatus.data4}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                        <el-descriptions class="margin-top" :column="2" border>
                                            <el-descriptions-item>
                                                <template slot="label">5.0um</template>
                                                {{dustStatus.data5}}
                                            </el-descriptions-item>
                                            <el-descriptions-item>
                                                <template slot="label">10.0um</template>
                                                {{dustStatus.data6}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                        <el-descriptions class="margin-top" :column="1" border>
                                            <el-descriptions-item>
                                                <template slot="label">空气洁净度</template>
                                                {{dustStatus.level}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                    </template>
                                </el-row>    
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="采样开关">
                            <el-form label-position="right" label-width="100px">
                                <el-button style="margin-left: 10px;" type="success" @click="simpleOn(1)">开启
                                </el-button>
                                <el-button style="margin-left: 10px; margin-left: 10px;" type="danger" @click="simpleOn(0)">关闭
                                </el-button>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="通道阈值">
                            <el-button style="margin-left: 10px;" type="primary" @click="getChannelValue()">查询阈值</el-button>
                            <el-form label-position="right" label-width="100px">
                            <template v-if="channelValue!=null">
                                <el-row>
                                    <el-col :span="24">
                                        0.3um通道:
                                        <el-input style="width: 200px; margin-top: 5px;" type="number" min="1" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                            v-model="channelValue.ch03"></el-input>
                                        <el-button type="primary" style="margin-left: 10px;" @click="setChannelValue('70' , channelValue.ch03)">设置</el-button>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="24">
                                        0.5um通道:
                                        <el-input style="width: 200px; margin-top: 5px;" type="number" min="1" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                            v-model="channelValue.ch05"></el-input>
                                        <el-button type="primary" style="margin-left: 10px;" @click="setChannelValue('72' , channelValue.ch05)">设置</el-button>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="24">
                                        1.0um通道:
                                        <el-input style="width: 200px; margin-top: 5px;" type="number" min="1" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                            v-model="channelValue.ch10"></el-input>
                                        <el-button type="primary" style="margin-left: 10px;" @click="setChannelValue('74' , channelValue.ch10)">设置</el-button>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="24">
                                        2.5um通道:
                                        <el-input style="width: 200px; margin-top: 5px;" type="number" min="1" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                            v-model="channelValue.ch25"></el-input>
                                        <el-button type="primary" style="margin-left: 10px;" @click="setChannelValue('76' , channelValue.ch25)">设置</el-button>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="24">
                                        5.0um通道:
                                        <el-input style="width: 200px; margin-top: 5px;" type="number" min="1" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                            v-model="channelValue.ch50"></el-input>
                                        <el-button type="primary" style="margin-left: 10px;" @click="setChannelValue('78' , channelValue.ch50)">设置</el-button>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="24">
                                        10um通道:
                                        <el-input style="width: 200px; margin-top: 5px;" type="number" min="1" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                            v-model="channelValue.ch100"></el-input>
                                        <el-button type="primary" style="margin-left: 10px;" @click="setChannelValue('7A' , channelValue.ch100)">设置</el-button>
                                    </el-col>
                                </el-row>
                            </template>
                            </el-form>
                        </el-tab-pane>
                        <!-- <el-tab-pane label="报警使能">
                            <el-form label-position="right" label-width="100px">
                                <el-button style="margin-left: 10px;" type="success" @click="dustClockOn(63)">开启
                                </el-button>
                                <el-button style="margin-left: 10px; margin-left: 10px;" type="danger" @click="dustClockOn(0)">关闭
                                </el-button>
                            </el-form>
                        </el-tab-pane> -->
                    </el-tabs>
                </el-dialog>
            </div>
            <div>
                <el-dialog title="调整排序" :visible.sync="sortFlag"
                           width="30%" @close="closeDialog" center :append-to-body="true">
                    选择操作的生产线:&nbsp;&nbsp;<el-select v-model="sortLineId" placeholder="请选择" style="width: 150px">
                        <el-option v-for="item in lines" :key="item.lineId" :label="item.lineName" :value="item.lineId">
                        </el-option>
                    </el-select>
                    <el-button type="primary" icon="el-icon-search" plain @click="searchSortData()" 
                        style="margin-left: 5px;" class="dalfBut">查询</el-button>
                    <br />
                    <el-scrollbar style="height: 500px;">
                        <el-table :data="sortDeviceList" border :highlight-current-row="true" style="margin-top: 10px;">
                            <el-table-column type="index" align="center" label="序号" width="50px" align="center"></el-table-column>
                            <el-table-column prop="stationId" label="终端编号" width="120px" align="center"></el-table-column>
                            <el-table-column prop="position" label="位置" width="200px" align="center"></el-table-column>
                            <el-table-column label="操作" align="center">
                                <template slot-scope="scope">
                                    <el-button v-if="scope.$index!=0" icon="el-icon-top" type="text" 
                                        style="color: green;"@click="handleSortUp(scope.$index)"></el-button>
                                    <el-button v-if="scope.$index!=(sortLength-1)" icon="el-icon-bottom" 
                                        style="color: red;" type="text" @click="handleSortDown(scope.$index)"></el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-scrollbar>
                </el-dialog>
            </div>
        </div>
    </div>
</div>
</body>
<!-- 引入组件库 -->
<script src="/backend/plugins/vue/vue.js"></script>
<script src="/backend/plugins/element-ui/index.js"></script>
<script type="text/javascript" src="/backend/plugins/jquery/jquery.min.js"></script>
<script src="/backend/plugins/axios/axios.min.js"></script>
<script src="/backend/js/request.js"></script>
<script src="/backend/js/device.js"></script>
<script src="/backend/js/common.js"></script>
<script src="/backend/js/fanApi.js"></script>
<script src="/backend/js/dzyApi.js"></script>
</html>